package com.chixing.day07_abstract.prototype;

public class ProductTest {
    public static void main(String[] args) throws CloneNotSupportedException {
        Product product = new Product();
        product.setpId(101);
        product.setProName("水");
        product.setProPrice(1.9f);


        Product cloneObj = product.clone();// new，101，“水”，1.9f
        System.out.println("原始对象"+product);
        System.out.println("克隆对象"+cloneObj);


       //创建一个Company对象，克隆一个Company对象
        Company company = new Company(201,"华为","民营企业","中国",555524);
        Company cloneCompany = company.clone();
        System.out.println("原始对象"+company);
        System.out.println("克隆对象"+cloneCompany);


       //创建一个Job对象，克隆一个Job对象
        Job job = new Job(301,company,"工程师",2554,58777,"大专","苏州");
        Job cloneJob = job.clone();
        System.out.println("原始对象"+job);
        System.out.println("克隆对象"+cloneJob);

    }
}
